#!/bin/bash

echo -e "---------------------------------------------------------"

echo -e "`date` --- begin clean caches"
free -h

echo -e "`date` --- sync and sleep"
sync
sync
sleep 15
sync
sync

echo -e "`date` --- drop clean caches"
echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches

echo -e "`date` --- finish clean caches"
free -h

echo -e "---------------------------------------------------------"

# 05 07,13,19,01 * * * sh /opt/job/cleanup-scripts/clean-host-cache.sh  >> /opt/job/cleanup-scripts/logs/clean-host-cache.log
